/* $Header: cmdproc.h,v 2.2 01/10/02 10:30:14 przybyls Exp $ */


/***********************************************************************/
/* INCLUDE FILE NAME: cmdproc.h                                        */
/* ==================                                                  */
/*                                                                     */
/* Author:  Bob Cook                                                   */
/*                                                                     */
/* COMMENT:                                                            */
/*          Include file for the command processor                     */
/*                                                                     */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

#ifndef CMDPROC_H
#define CMDPROC_H

/*****************************/
/*   IFDEFS                  */
/*****************************/


/*****************************/
/*   SYMBOLIC CONSTANTS      */
/*****************************/


/*
 * NOTE: because of the 16 bit address field in an MIO header the total
 *   size of all read or all write buffers must be less the 64k.
 */
/* define number of read and write packets to be created */
#define  NUM_RD_PACKETS    12
#define  NUM_WR_PACKETS    20

/* define size of read and write packet data buffers */
#define  RD_BUF_SIZE    512
#define  WR_BUF_SIZE    1024



/* states used in Scan()'s state machine */
#define PARAMETER    0
#define BEGIN        1
#define WHITE_SPACE  2
#define SEPARATE     3
#define STRING       4
#define STRING2      5

/* number of commands buffers created */
#define NUM_CMD_BUFS     20

/* parameter returned from Do_XX commands when there is no response to cmd */
#define NO_RESPONSE  -1


/*****************************/
/*   MACROS                  */
/*****************************/


/*****************************/
/*   TYPEDEFS                */
/*****************************/

typedef enum
{
   INSTALL_IDLE,
   INSTALL_ACTIVE,
   INSTALL_COMPLETE
} INSTALL_STATE_TYPE;

/*****************************/
/*   EXTERNAL VARIABLES      */
/*****************************/

extern INSTALL_STATE_TYPE Install_State;

/******** Cmd Buffers *********/
/* a queue of free command buffers */
extern  CMD_QUEUE_TYPE      Free_Cmd_Q;
/* a queue of GC commands (signal 1) */
extern  CMD_QUEUE_TYPE      GC_Cmd_Q;
/* a queue of S1 commands (signal 1) */
extern  CMD_QUEUE_TYPE      S1_Cmd_Q;
/* a queue of S2 commands (signal 2) */
extern  CMD_QUEUE_TYPE      S2_Cmd_Q;
/* a queue of SP commands (signal 2) */
extern  CMD_QUEUE_TYPE      SP_Cmd_Q;
/* a queue of S2 commands (synchronized signals) */
extern  CMD_QUEUE_TYPE      SS_Cmd_Q;
/* a queue of CC commands (chemcomm) */
extern  CMD_QUEUE_TYPE      CC_Cmd_Q;
/* a queue of DT commands (diagnostic) */
extern  CMD_QUEUE_TYPE      DT_Cmd_Q;
/* a queue of OV commands (oven) */
extern  CMD_QUEUE_TYPE      OV_Cmd_Q;
/* a queue of IX commands (injector) */
extern  CMD_QUEUE_TYPE      IX_Cmd_Q;
/* a queue of DX commands (detector) */
extern   CMD_QUEUE_TYPE      DX_Cmd_Q;
/* a queue of CX commands (columns) */
extern   CMD_QUEUE_TYPE      CX_Cmd_Q;
/* a queue of AX commands (aux) */
extern  CMD_QUEUE_TYPE      AX_Cmd_Q;
/* a queue of VX commands (detector) */
extern   CMD_QUEUE_TYPE      VX_Cmd_Q;
/* a queue of AS commands (auto sampler) */
extern   CMD_QUEUE_TYPE      AS_Cmd_Q;
/* a queue of Pass Through commands for (auto sampler) */
extern   CMD_QUEUE_TYPE      _0X_Cmd_Q;
/* a queue of PX commands (Pass Through command from sampler port */
extern  CMD_QUEUE_TYPE      PX_Cmd_Q;
/* a queue of DT commands (detector) */
extern   CMD_QUEUE_TYPE      DT_Cmd_Q;
/* a queue of TP commands (detector) */
extern   CMD_QUEUE_TYPE      TP_Cmd_Q;
/* a queue of Q0 commands (internal IQ location - use GetMsg) */
extern  CMD_QUEUE_TYPE      Q0_Cmd_Q;
/* a queue of Q1 commands (internal IQ location - use GetCmd) */
extern  CMD_QUEUE_TYPE      Q1_Cmd_Q;
/* a queue of Q2 commands ( use GetQ2Msg) */
extern  CMD_QUEUE_TYPE      Q2_Cmd_Q;
/* a queue of Q3 commands (internal IQ location - use GetQ3Msg) */
extern  CMD_QUEUE_TYPE      Q3_Cmd_Q;   /* 2nd ALS pass through channel */
/* a queue of ALS ping replies (use GetCmd) */
extern  CMD_QUEUE_TYPE      Ping_Q;
/* a queue of ALS Inj replies (use GetCmd) */
extern  CMD_QUEUE_TYPE      Inj_Q;
/* a queue of headspace sampler replies (use GetCmd) */
extern  CMD_QUEUE_TYPE      HS_Cmd_Q;
/* a queue of free write packets */
extern  QUEUE_TYPE      Wr_Free_Q;

/* table of defined communication paths */
extern  PATH_TYPE      Com_Path[];

/*****************************/
/*   FUNCTION PROTOTYPES     */
/*****************************/


#endif
